package com.lin.eventbus.callback;

import org.jetbrains.annotations.NotNull;

public class CallbackException extends RuntimeException {
    private static final long serialVersionUID = 8739931958023711661L;

    private CallbackException(Throwable cause) {
        super(cause);
    }

    public static void throwException(@NotNull Throwable cause) {
        if (cause instanceof RuntimeException) {
            throw (RuntimeException) cause;
        }
        throw new CallbackException(cause);
    }
}
